<?php require_once LAYOUTPATH.'layout_header.php'; ?>

<?php require_once APPPATH.'views/bricabox/header.php'; ?>

<div id="blocks">
	
	<?php
	$location = 'content';
	require_once APPPATH.'views/blocks/blocks_gallery.php';
	?>
	
	<?php
	$size = "large";
	echo "<div class=\"column {$location} edit_{$edit_layout}\" id=\"blocks_{$size}\">\n";
	require APPPATH.'views/blocks/blocks_dragdrop.php';
	?>
	
	<!-- Title and content data -->
	<h1>
		<img style="padding:2px;margin-bottom:5px;" src="<?php echo url_for_avatar($content->content_image, $content->id, 'content', 'original'); ?>" alt="" /><br />
		<a href="<?php echo content_url($content); ?>" title="Permalink to this entry"><?php echo xml_convert($content->field1_value); ?></a>
		<?php if ($this->Membership_model->is_owner($bricabox->id) || $this->Content_model->user_can_edit($this->userland->current_user(), $content->user_id)): ?><a href="/content/<?php echo $content->id; ?>/edit" title="Edit this entry"><img src="/assets/images/icons/pencil_edit.png" alt="Edit this entry" /></a><?php endif; ?>
			
	</h1>
	<h2><?php if (!$edit_layout) echo auto_typography(ascii_to_entities(auto_link($this->Content_model->content_data($content), 'both', true))); ?></h2>
	<?php if ($content->data_file_upload): ?>
	<a style="border: none;" href="<?php echo url_for_attachment($content->data_file_upload, $content->id); ?>"><img style="vertical-align: middle;" src="/assets/images/icons/attach.png" alt="Attachment" /><?php echo $content->data_file_upload; ?></a>
	<?php endif; ?>
	
	<!-- Share this! -->
	<div class="share_this">
		<script type="text/javascript" src="http://w.sharethis.com/widget/?tabs=web%2Cemail&amp;charset=utf-8&amp;style=rotate&amp;publisher=9f59e891-37a0-4d3d-a49f-51e1d1f3b7bc"></script>
	</div>
	<div style="margin-top:11px;">
		<!-- Flag -->
		<a title="Flag this entry if it is inappropriate" id="flag_<?php echo $content->id; ?>" href="javascript:void(0);" style="border:none;font-size:10px;color:#de3231 !important;background:#fff !important;" onclick="$.post('/content/<?php echo $content->id; ?>/flag', {bricabox_id: <?php echo $content->bricabox_id; ?>});$('#flag_<?php echo $content->id; ?>').hide();$('#wrap_inner').prepend('<h5 class=\'alert good\'>This entry has been flagged.</h5>');">FLAG</a>
	</div>
	
	<?php
	require APPPATH.'views/blocks/blocks_side.php';
	?>
	
		
	</div>
	
	<?php
	$size = "small";
	echo "<div class=\"column {$location} edit_{$edit_layout}\" id=\"blocks_{$size}\">\n";
	require APPPATH.'views/blocks/blocks_dragdrop.php';
	?>
		
	<!-- Engagement -->
	<?php if ($bricabox->allow_engagement): ?>
	<div class="engage">
		<div class="engage_count">
			<?php echo $engage->count_for_entry($bricabox, $content); ?>
		</div>
		<div class="engage_form">
			<?php echo $engage->form_for_entry($bricabox, $content, $this->userland->current_user()); ?>
		</div>
	</div>
	<?php endif; ?>
	
	<?php
	require APPPATH.'views/blocks/blocks_side.php';
	?>
	
	</div>
</div>

<div id="blocks">
	<?php
	//$location = 'content';
	//require_once APPPATH.'views/blocks/blocks.php';
	?>
</div>



<?php require_once LAYOUTPATH.'layout_footer.php'; ?>